/** 
 * BinaryExpression.java
 * @author Lex
 * 2007-8-20 ����04:30:18
 */
package fun.parser.ast.node.base;

import fun.parser.lexer.Token;

/**
 * 
 */
public abstract class BinaryExpression extends Expression {
	protected Expression first = null;
	protected Expression second = null;

	public BinaryExpression(Token token, Expression first, Expression second) {
		super(token);
		this.first = first;
		this.second = second;
		this.setChildren(new Expression[] { first, second });
	}

	public Expression getFirstExpression() {
		return this.first;
	}

	public Expression getSecondExpression() {
		return this.second;
	}

	public String toString() {
		StringBuilder b = new StringBuilder();
		b.append(first.toString()).append(' ');
		b.append(this.getToken().getImage()).append(' ');
		b.append(second.toString());
		return b.toString();
	}
}
